/*
 *
 */
#include "../../dprint.h"
#include "utilities.h"

#include "dialogFailureRate.h"

extern time_t up_since;

/*
 *
 */
void print_dialog_failure_rate(unsigned int ticks, void *param) {

    time_t now;
    time(&now);

    int sys_uptime = now - up_since;

    int failed = get_statistic("failed_dialogs");
    int total  = get_statistic("processed_dialogs");

    INFO("System has run for: %d day(s) %d hour(s) %d minute(s) %d second(s)",
          sys_uptime / 86400,
          sys_uptime % 86400 / 3600,
          sys_uptime % 3600 / 60,
          sys_uptime % 60);

    INFO("Dialogs processed: %d, established: %d", total, (total - failed));
}
